Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

track adt variant and field names do not conflict #175

Merged
merged 5 commits into from
Jul 2, 2024

Conversation

shua
Copy link
Contributor

@shua shua commented Jun 22, 2024

The intent of this change is to add a check for adts that enum variant names are unique, and that struct and enum field names are unique (within a given enum variant).

The intent of this change is to add a check for adts that enum variant
names are unique, and that struct and enum field names are unique
(within a given enum variant).
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good modulo @lcnr's suggestion

@shua shua requested review from lcnr and nikomatsakis June 25, 2024 15:03
crates/formality-check/src/adts.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there!

src/test/mod.rs Outdated
}
]

[ /* TODO */ ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add suggested messages in here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I copied this from pre-existing tests in this file, so I had no idea what to put here, but scrolled down and found some other examples. This is supposed to be some summary of what's wrong with the code?

Copy link
Contributor Author

@shua shua Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah wait, maybe instead it's some relevant substring in the error output that shouldn't change even when you update the expect output? (guessing from assert_err! naming that tt must_have and the other expect)

src/test/mod.rs Outdated
}
]

[ /* TODO */ ]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

@nikomatsakis nikomatsakis merged commit 15ce6cf into rust-lang:main Jul 2, 2024
3 checks passed
@shua shua deleted the uniq branch July 2, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants